<?php

/**
 * Usuario form base class.
 *
 * @method Usuario getObject() Returns the current form's model object
 *
 * @package    costabravasfr
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 24171 2009-11-19 16:37:50Z Kris.Wallsmith $
 */
abstract class BaseUsuarioForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                  => new sfWidgetFormInputHidden(),
      'nombreusuario'       => new sfWidgetFormInputText(),
      'nombreAgencia'       => new sfWidgetFormInputText(),
      'contrato'            => new sfWidgetFormInputText(),
      'nombreAdmin'         => new sfWidgetFormInputText(),
      'apellidosAdmin'      => new sfWidgetFormInputText(),
      'address'             => new sfWidgetFormInputText(),
      'localidadAgencia'    => new sfWidgetFormInputText(),
      'codigopostal'        => new sfWidgetFormInputText(),
      'geolatitud_user'     => new sfWidgetFormInputText(),
      'geolongitud_user'    => new sfWidgetFormInputText(),
      'quienessomos_ca'     => new sfWidgetFormInputText(),
      'quienessomos_ca_red' => new sfWidgetFormTextarea(),
      'quienessomos_es'     => new sfWidgetFormInputText(),
      'quienessomos_es_red' => new sfWidgetFormTextarea(),
      'quienessomos_en'     => new sfWidgetFormInputText(),
      'quienessomos_en_red' => new sfWidgetFormTextarea(),
      'quienessomos_fr'     => new sfWidgetFormInputText(),
      'quienessomos_fr_red' => new sfWidgetFormTextarea(),
      'quienessomos_nl'     => new sfWidgetFormInputText(),
      'quienessomos_nl_red' => new sfWidgetFormTextarea(),
      'quienessomos_de'     => new sfWidgetFormInputText(),
      'quienessomos_de_red' => new sfWidgetFormTextarea(),
      'quienessomos_it'     => new sfWidgetFormInputText(),
      'quienessomos_it_red' => new sfWidgetFormTextarea(),
      'background_image'    => new sfWidgetFormInputText(),
      'logo_image'          => new sfWidgetFormInputText(),
      'telefonofijo'        => new sfWidgetFormInputText(),
      'telefonomovil'       => new sfWidgetFormInputText(),
      'fax'                 => new sfWidgetFormInputText(),
      'web'                 => new sfWidgetFormInputText(),
      'email'               => new sfWidgetFormInputText(),
      'sf_guard_user_id'    => new sfWidgetFormInputText(),
      'activoUser'          => new sfWidgetFormInputCheckbox(),
      'created_at'          => new sfWidgetFormDateTime(),
      'updated_at'          => new sfWidgetFormDateTime(),
      'slug'                => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'id'                  => new sfValidatorDoctrineChoice(array('model' => $this->getModelName(), 'column' => 'id', 'required' => false)),
      'nombreusuario'       => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'nombreAgencia'       => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'contrato'            => new sfValidatorInteger(array('required' => false)),
      'nombreAdmin'         => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'apellidosAdmin'      => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'address'             => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'localidadAgencia'    => new sfValidatorString(array('max_length' => 100, 'required' => false)),
      'codigopostal'        => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'geolatitud_user'     => new sfValidatorNumber(array('required' => false)),
      'geolongitud_user'    => new sfValidatorNumber(array('required' => false)),
      'quienessomos_ca'     => new sfValidatorPass(array('required' => false)),
      'quienessomos_ca_red' => new sfValidatorString(array('required' => false)),
      'quienessomos_es'     => new sfValidatorPass(array('required' => false)),
      'quienessomos_es_red' => new sfValidatorString(array('required' => false)),
      'quienessomos_en'     => new sfValidatorPass(array('required' => false)),
      'quienessomos_en_red' => new sfValidatorString(array('required' => false)),
      'quienessomos_fr'     => new sfValidatorPass(array('required' => false)),
      'quienessomos_fr_red' => new sfValidatorString(array('required' => false)),
      'quienessomos_nl'     => new sfValidatorPass(array('required' => false)),
      'quienessomos_nl_red' => new sfValidatorString(array('required' => false)),
      'quienessomos_de'     => new sfValidatorPass(array('required' => false)),
      'quienessomos_de_red' => new sfValidatorString(array('required' => false)),
      'quienessomos_it'     => new sfValidatorPass(array('required' => false)),
      'quienessomos_it_red' => new sfValidatorString(array('required' => false)),
      'background_image'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'logo_image'          => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'telefonofijo'        => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'telefonomovil'       => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'fax'                 => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'web'                 => new sfValidatorString(array('max_length' => 200, 'required' => false)),
      'email'               => new sfValidatorEmail(array('max_length' => 100, 'required' => false)),
      'sf_guard_user_id'    => new sfValidatorPass(array('required' => false)),
      'activoUser'          => new sfValidatorBoolean(array('required' => false)),
      'created_at'          => new sfValidatorDateTime(),
      'updated_at'          => new sfValidatorDateTime(),
      'slug'                => new sfValidatorString(array('max_length' => 255, 'required' => false)),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorDoctrineUnique(array('model' => 'Usuario', 'column' => array('slug')))
    );

    $this->widgetSchema->setNameFormat('usuario[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Usuario';
  }

}
